This script exports polygonal geometry as Half-Life map brushes. Each mesh triangle is converted to an individual brush shaped like a tetrahedron. The original triangle face is correctly textured, and the brush's three extra faces are assigned the NULL texture.
This exporter is intended for making decorations for your maps rather than complete map geometry. Don't expect the resulting .map files to compile to waterproof .bsps. It's possible but unlikely. However, using your exported fragments in larger maps works pretty well.
Install this script as an add-on:
The add-on associates texture names on brush faces with the names of materials on meshes (not with the names of Blender textures). Your materials should be named exactly as you want the resulting texture references to look in the map files.
In addition to the texture name, the width and height of the texture image must exactly match those in the game. This is required for correct texture application. To get the the image width and height, the exporter looks at the material's associated textures and uses the dimensions of the first image texture that it finds. If you don't have the exact same image handy, create a blank image texture with the right dimensions directly in Blender.
If no texture is attached to a material, the dimensions are assumed to be 64x64.
For faces that don't have a material assigned, the CLIP texture is written.